import request from '@/plugin/axios'

/*
***首页数据
*/
//数据
export function getIndex(){
	return request({
		url:'/managea/index',
		method:'get'
	})
}
//图表
export function getOrderStatistics(type){
	return request({
		url:'/managea/orderStatistics/'+type,
		method:'get'
	})
}

/* 
***人员管理
 */
//列表
export function getAdminuser(data){
	return request({
		url:'/managea/adminuser',
		method:'get',
		params:data
	})
}
//添加
export function postAdminAdd(data){
	return request({
		url:'/managea/adminAdd',
		method:'post',
		data
	})
}
//修改详情
export function getAdminEdit(id){
	return request({
		url:'/managea/adminEdit/'+id,
		method:'get'
	})
}
//删除
export function getAdminDel(id){
	return request({
		url:'/managea/adminDel/'+id,
		method:'get'
	})
}
//修改
export function postAdminUpdate(data){
	return request({
		url:'/managea/adminUpdate',
		method:'post',
		data
	})
}
//封号
export function postAdminState(data){
	return request({
		url:'/managea/adminState',
		method:'post',
		data
	})
}
/* 
 ***用户管理
 */
//用户列表 带分页
export function getUser(data){
	return request({
		url:'/managea/user',
		method:'get',
		params:data
	})
}
//用户列表 不分页
export function getUserList(){
	return request({
		url:'/managea/userList',
		method:'get'
	})
}
//用户状态更改
export function getUserState(id){
	return request({
		url:'/managea/userState/'+id,
		method:'get'
	})
}
//消费明细
export function postUserLog(data){
	return request({
		url:'/managea/userLog',
		method:'post',
		data
	})
}
/* 
 ***充值管理
 */
//列表
export function getRecharge(data){
	return request({
		url:'/managea/Recharge',
		method:'get',
		params:data
	})
}
//添加
export function postRechargeAdd(data){
	return request({
		url:'/managea/RechargeAdd',
		method:'post',
		data
	})
}
//充值开启关闭
export function getRechargeState(id){
	return request({
		url:'/managea/RechargeState/'+id,
		method:'get'
	})
}
//充值修改详情
export function getRechargeEdit(id){
	return request({
		url:'/managea/RechargeEdit/'+id,
		method:'get'
	})
}
//充值修改提交
export function postRechargeUpdate(data){
	return request({
		url:'/managea/RechargeUpdate',
		method:'post',
		data
	})
}
//删除
export function getRechargeDel(id){
	return request({
		url:'/managea/RechargeDel/'+id,
		method:'get'
	})
}

/* 充值记录 */
//列表
export function getRechargeLog(data){
	return request({
		url:'/managea/RechargeLog',
		method:'get',
		params:data
	})
}
/* 
 ***商品管理
 */
//规格
export function getGuige(){
	return request({
		url:'/managea/Guige',
		method:'get'
	})
}
//规格添加
export function postGuigeAdd(data){
	return request({
		url:'/managea/GuigeAdd',
		method:'post',
		data
	})
}
//规格修改显示
export function getGuigeEdit(id){
	return request({
		url:'/managea/GuigeEdit/'+id,
		method:'get'
	})
}
//规格修改提交
export function postGuigeUpdate(data){
	return request({
		url:'/managea/GuigeUpdate',
		method:'post',
		data
	})
}
//规格删除
export function getGuigeDel(id){
	return request({
		url:'/managea/GuigeDel/'+id,
		method:'get'
	})
}
//产品列表 
export function getProduct(data){
	return request({
		url:'/managea/Product',
		method:'get',
		params:data
	})
}
//套餐列表
export function getPackagelist(data){
	return request({
		url:'/managea/Packagelist',
		method:'get',
		params:data
	})
}
//套餐修改  
export function getPackageInfo(id){
	return request({
		url:'/managea/PackageInfo/'+id,
		method:'get'
	})
}
//套餐删除    
export function getPackageDel(id){
	return request({
		url:'/managea/PackageDel/'+id,
		method:'get'
	})
}
//获取所有分类 
export function getPackageAddList(){
	return request({
		url:'/managea/PackageAddList',
		method:'get'
	})
}
//获取当前分类下所有产品   
export function getPackageAddListCur(id){
	return request({
		url:'/managea/PackageAddList?id='+id,
		method:'get'
	})
}
//套餐添加
export function postPackageAdd(data){
	return request({
		url:'/managea/PackageAdd',
		method:'post',
		data
	})
}
//套餐修改 
export function postPackageEdit(data){
	return request({
		url:'/managea/PackageEdit',
		method:'post',
		data
	})
}
//产品添加
export function postProductAdd(data){
	return request({
		url:'/managea/ProductAdd',
		method:'post',
		data
	})
}
//产品修改详情
export function getProductEdit(id){
	return request({
		url:'/managea/ProductEdit/'+id,
		method:'get'
	})
}
//产品修改提交
export function postProductUpdate(data){
	return request({
		url:'/managea/ProductUpdate',
		method:'post',
		data
	})
}
//产品开启关闭
export function getProductState(id){
	return request({
		url:'/managea/ProductState/'+id,
		method:'get'
	})
}
//产品删除
export function getProductDel(id){
	return request({
		url:'/managea/ProductDel/'+id,
		method:'get'
	})
}
//一键上架
export function postProductPlsj(data){
	return request({
		url:'/managea/ProductPlsj',
		method:'post',
		data
	})
}
//一键下架
export function postProductPlxj(data){
	return request({
		url:'/managea/ProductPlxj',
		method:'post',
		data
	})
}

//自选套餐
//列表
export function getDapei(){
	return request({
		url:'/managea/Dapei',
		method:'get'
	})
}
//添加
export function postDapeiAdd(data){
	return request({
		url:'/managea/DapeiAdd',
		method:'post',
		data
	})
}
//修改 详情显示
export function getDapeiEdit(id){
	return request({
		url:'/managea/DapeiEdit/'+id,
		method:'get'
	})
}
// 修改 编辑操作
export function postDapeiUpdate(data){
	return request({
		url:'/managea/DapeiUpdate',
		method:'post',
		data
	})
}
// 搭配 开启关闭
export function getDapeiState(id){
	return request({
		url:'/managea/DapeiState/'+id,
		method:'get'
	})
}





/* 
 ***分类管理
 */
//列表  带分页
export function getCategory(data){
	return request({
		url:'/managea/Category',
		method:'get',
		params:data
	})
}
//列表 不带分页
export function getCategoryList(){
	return request({
		url:'/managea/CategoryList',
		method:'get'
	})
}
//添加
export function postCategoryAdd(data){
	return request({
		url:'/managea/CategoryAdd',
		method:'post',
		data
	})
}
//修改显示
export function getCategoryEdit(id){
	return request({
		url:'/managea/CategoryEdit/'+id,
		method:'get'
	})
}
//修改提交
export function postCategoryUpdate(data){
	return request({
		url:'/managea/CategoryUpdate',
		method:'post',
		data
	})
}
//删除
export function getCategoryDel(id){
	return request({
		url:'/managea/CategoryDel/'+id,
		method:'get'
	})
}

/* 
 ***订单管理
 */
//列表
export function getOrder(data){
	return request({
		url:'/managea/Order',
		method:'get',
		params:data
	})
}
//详情 修改
export function getOrderEdit(id){
	return request({
		url:'/managea/OrderEdit/'+id,
		method:'get'
	})
}
//订单修改操作
export function postOrderUpdate(data){
	return request({
		url:'/managea/OrderUpdate',
		method:'post',
		data
	})
}
//退款
export function getOrderBack(id){
	return request({
		url:'/managea/OrderBack/'+id,
		method:'get'
	})
}
/* 
 ***联系客服
 */
//信息
export function getContactInfo(){
	return request({
		url:'/managea/ContactInfo',
		method:'get'
	})
}
//提交
export function postContactUpdate(data){
	return request({
		url:'/managea/ContactUpdate',
		method:'post',
		data
	})
}
/* 
 ***配送管理
 */
export function getDeliveryInfo(){
	return request({
		url:'/managea/DeliveryInfo',
		method:'get'
	})
}
//修改提交
export function postDeliveryUpdate(data){
	return request({
		url:"/managea/DeliveryUpdate",
		method:'post',
		data
	})
}
/* 
***优惠卷 
 */
//列表
export function getPrefer(page){
	return request({
		url:'/managea/Prefer',
		method:'get',
		params:page
	})
}
//添加
export function postPreferAdd(data){
	return request({
		url:'/managea/PreferAdd',
		method:'post',
		data
	})
}
//修改 详情
export function getPreferEdit(id){
	return request({
		url:'/managea/PreferEdit/'+id,
		method:'get'
	})
}
//修改提交
export function postPreferUpdate(data){
	return request({
		url:'/managea/PreferUpdate',
		method:'post',
		data
	})
}
//删除
export function getPreferDel(id){
	return request({
		url:'/managea/PreferDel/'+id,
		method:'get'
	})
}
//优惠卷发放
export function postPreferFa(data){
	return request({
		url:'/managea/PreferFa',
		method:'post',
		data
	})
}
//优惠卷发放详情
export function getPreferlog(id,page){
	return request({
		url:'/managea/Preferlog/'+id,
		method:'get',
		params:page
	})
}

// 轮播图
//轮播图列表
export function getBanner(data) {
	return request({
		url: '/managea/banner',
		method: 'get',
		params: data
	})
}
//添加
export function postBannerAdd(data) {
	return request({
		url: '/managea/bannerAdd',
		method: 'post',
		data
	})
}
//修改  详情
export function getBannerEdit(id) {
	return request({
		url: '/managea/bannerEdit/' + id,
		method: 'get'
	})
}
//修改 提交
export function postBannerUpdate(data) {
	return request({
		url: '/managea/bannerUpdate',
		method: 'post',
		data
	})
}
// 删除
export function getBannerDel(id) {
	return request({
		url: '/managea/bannerDel/' + id,
		method: 'get'
	})
}